import http from '../utils/http'

// 获取商品分类数据
export const reqCategoryData = () => {
  return http.get('/index/findCategoryTree')
}

// 获取商品列表
export const reqGoodsList = (params) => {
  return http.get('/list', params)
}

// 获取商品详情
export const reqGoodsDetail = (goodsId) => {
  return http.get(`/item/${goodsId}`)
}

// 获取商品评价
export const reqGoodsComment = (goodsId) => {
  return http.get(`/comment/${goodsId}`)
}

// 搜索商品
export const reqSearchGoods = (keyword) => {
  return http.get('/search', { keyword })
}

// 获取商品规格
export const reqGoodsSpecs = (goodsId) => {
  return http.get(`/item/specs/${goodsId}`)
}

// 获取商品价格
export const reqGoodsPrice = (goodsId) => {
  return http.get(`/item/price/${goodsId}`)
}

// 获取商品库存
export const reqGoodsStock = (goodsId) => {
  return http.get(`/item/stock/${goodsId}`)
} 